#include <memory.h>
#include "game.h"

SMap::SMap()
{
	ClearCells();
};

SMap::SMap( uint16_t width, uint16_t depth )
{ 
	Width = width; Depth = depth; ClearCells(); 
};

void SMap::Init( uint16_t width, uint16_t depth )
{ 
	Width = width; Depth = depth; ClearCells(); 
};

void SMap::ClearCells( void )
{
	int linearSize = MAX_MAP_DEPTH*MAX_MAP_WIDTH;
	memset( CellsFloor,		TILE_WALL, sizeof(id_t)*linearSize );
	memset( CellsCharacter,	INVALID_ID, sizeof(id_t)*linearSize );
	memset( CellsItem,		INVALID_ID, sizeof(id_t)*linearSize );
};

void SMap::ClearCellsFloor( void )		{ memset( CellsFloor,		INVALID_ID, sizeof(id_t)*MAX_MAP_DEPTH*MAX_MAP_WIDTH ); };
void SMap::ClearCellsCharacter( void )	{ memset( CellsCharacter,	INVALID_ID, sizeof(id_t)*MAX_MAP_DEPTH*MAX_MAP_WIDTH ); };
void SMap::ClearCellsItem( void )		{ memset( CellsItem,		INVALID_ID, sizeof(id_t)*MAX_MAP_DEPTH*MAX_MAP_WIDTH ); };
